<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <style>
      img {
        width: 300px;
        height: 300px;
      }
    </style>
  </head>
  <body>
    <button>点击获取</button>
    <div>
      <img src="https://images6.alphacoders.com/546/546048.jpg" />
    </div>
  </body>
  <script>
    const btn = document.querySelector("button");
    btn.onclick = function () {
      axios
        .request({
          // url: "http://pvp.qq.com/web201605/js/herolist.json",
          // url: "https://api.wer.plus/api/mowal",
          url: "http://127.0.0.1:9527/rookie",
          methods: "get",
          params: {},
        })
        .then((v) => {
          console.log(v.data);
          //   if (v.data.code == 200) {
          //     document.querySelector(
          //       "div"
          //     ).innerHTML = `<img src="${v.data.url}" />`;
          //     console.log(document.querySelector("div"));
          //   }
        });
    };
  </script>
</html>
